package com.ruoyi.ui.service.impl;

import java.util.List;

import com.ruoyi.ui.domain.UiAttr;
import com.ruoyi.ui.domain.vo.UiAttrVo;
import com.ruoyi.ui.domain.vo.UiCategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ui.mapper.UiCategoryMapper;
import com.ruoyi.ui.domain.UiCategory;
import com.ruoyi.ui.service.IUiCategoryService;

/**
 * 分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-06
 */
@Service
public class UiCategoryServiceImpl implements IUiCategoryService 
{
    @Autowired
    private UiCategoryMapper uiCategoryMapper;

    /**
     * 查询分类
     * 
     * @param categoryId 分类主键
     * @return 分类
     */
    @Override
    public UiCategory selectUiCategoryByCategoryId(Long categoryId)
    {
        return uiCategoryMapper.selectUiCategoryByCategoryId(categoryId);
    }

    /**
     * 查询分类列表
     * 
     * @param uiCategory 分类
     * @return 分类
     */
    @Override
    public List<UiCategoryVo> selectUiCategoryList(UiCategoryVo uiCategory)
    {
        return uiCategoryMapper.selectUiCategoryList(uiCategory);
    }

    /**
     * 新增分类
     * 
     * @param uiCategory 分类
     * @return 结果
     */
    @Override
    public int insertUiCategory(UiCategory uiCategory)
    {
        return uiCategoryMapper.insertUiCategory(uiCategory);
    }

    /**
     * 修改分类
     * 
     * @param uiCategory 分类
     * @return 结果
     */
    @Override
    public int updateUiCategory(UiCategory uiCategory)
    {
        return uiCategoryMapper.updateUiCategory(uiCategory);
    }

    /**
     * 批量删除分类
     * 
     * @param categoryIds 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteUiCategoryByCategoryIds(Long[] categoryIds)
    {
        return uiCategoryMapper.deleteUiCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除分类信息
     * 
     * @param categoryId 分类主键
     * @return 结果
     */
    @Override
    public int deleteUiCategoryByCategoryId(Long categoryId)
    {
        return uiCategoryMapper.deleteUiCategoryByCategoryId(categoryId);
    }
    @Override
    public List<UiAttrVo> selectUiAttrList(UiAttrVo uiAttr)
    {
        return uiCategoryMapper.selectUiAttrList(uiAttr);
    }
}
